package com.jasonli.service.impl;

import com.jasonli.dao.ProductTypeDao;
import com.jasonli.domain.ProductType;
import com.jasonli.service.ProductTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductTypeServiceImpl implements ProductTypeService {

    @Autowired
    private ProductTypeDao typeDao;

    public boolean save(ProductType type) {
        typeDao.save(type);
        return true;
    }

    public boolean delete(Integer tid) {
        typeDao.delete(tid);
        return true;
    }

    public boolean update(ProductType type) {
        typeDao.update(type);
        return true;
    }

    public ProductType getByTid(Integer tid) {
        return typeDao.getByTid(tid);
    }

    public List<ProductType> getAll() {
        return typeDao.getAll();
    }

}
